<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>修改个人资料</title>
    <style>
        body, html {
            height: 100%;
            margin: 0;
            font-family: Arial, sans-serif;
        }

        .sidebar {
            width: 90px;
            background-color: #333;
            color: white;
            padding: 15px;
            position: fixed;
            top: 0;
            left: 0;
            height: 100%;
        }

        .sidebar h2 {
            padding: 10px;
            color: #fff;
        }

        .sidebar ul {
            list-style-type: none;
            padding: 0;
        }

        .sidebar ul li a {
            color: white;
            padding: 10px;
            display: block;
            text-decoration: none;
        }

        .sidebar ul li a:hover {
            background-color: #575757;
        }

        .sidebar ul li a.active {
            background-color: #4CAF50;
        }

        .main-content {
            margin-left: 120px;
            padding: 20px;
        }

        .header {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 10px 0;
        }

        .content {
            padding: 20px;
        }

        form {
            width: 400px;
            margin: 0 auto;
            line-height: 2;
        }

        label {
            display: inline-block;
            width: 100px;
            font-weight: bold;
        }

        input[type="text"], input[type="number"], input[type="password"] {
            width: 250px;
            padding: 5px;
            margin-bottom: 10px;
        }

        input[type="submit"] {
            background-color: #4CAF50;
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            margin-top: 10px;
        }

        input[type="submit"]:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
<div class="sidebar">
    <h2>菜单</h2>
    <ul>
        <li><a href="${pageContext.request.contextPath}/application/bookList.jsp" class="<%= request.getRequestURI().endsWith("bookList.jsp")? "active" : "" %>">图书列表</a></li>
        <li><a href="${pageContext.request.contextPath}/application/addBook.jsp" class="<%= request.getRequestURI().endsWith("addBook.jsp")? "active" : "" %>">添加图书</a></li>
        <li><a href="${pageContext.request.contextPath}/application/borrowRecord.jsp" class="<%= request.getRequestURI().endsWith("borrowRecord.jsp")? "active" : "" %>">借阅记录</a></li>
        <li><a href="${pageContext.request.contextPath}/application/readerList.jsp" class="<%= request.getRequestURI().endsWith("readerList.jsp")? "active" : "" %>">读者列表</a></li>
        <li><a href="${pageContext.request.contextPath}/application/PersonalData.jsp" class="<%= request.getRequestURI().endsWith("PersonalData.jsp")? "active" : "" %>">个人中心</a></li>
        <li><a href="${pageContext.request.contextPath}/login.jsp">退出登录</a></li>
    </ul>
</div>

<div class="main-content">
    <div class="header">
        <a>图书信息管理系统 - 修改资料</a>
    </div>
    <div class="content">
        <h2>修改个人信息</h2>
        <form action="${pageContext.request.contextPath}/personalData" method="post">
            <label>姓名：</label><input type="text" name="name" value="${reader.name}"><br>
            <label>性别：</label><input type="text" name="gender" value="${reader.gender}"><br>
            <label>年龄：</label><input type="number" name="age" value="${reader.age}"><br>
            <label>联系方式：</label><input type="text" name="contact_info" value="${reader.contact_info}"><br>
            <label>证件类型：</label><input type="text" name="id_type" value="${reader.id_type}"><br>
            <label>证件号码：</label><input type="text" name="id_number" value="${reader.id_number}"><br>
            <label>借阅上限：</label><input type="number" name="borrow_limit" value="${reader.borrow_limit}"><br>
            <label>借阅期限：</label><input type="number" name="borrow_period" value="${reader.borrow_period}"><br>
            <label>可续借：</label>
            <input type="checkbox" name="can_renew" <c:if test="${reader.can_renew}">checked</c:if>><br>
            <label>新密码：</label><input type="password" name="newPassword"><br>

            <input type="submit" value="提交修改">
        </form>
    </div>
</div>
</body>
</html>
